﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace BusinessLogic
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "RandomNumberGenerator" in code, svc and config file together.
    /// <summary>
    /// This class is used to generate a random 6-digit number which will be used to report a faulty product
    /// </summary>
    public class RandomNumberGenerator : IRandomNumberGenerator
    {
        /// <summary>
        /// A method which generates a random 6-digit number which will be used to report a faulty product
        /// </summary>
        /// <returns>A 6-digit random number</returns>
        public string GenerateRandomNumber()
        {
            string num = "";
            Random r = new Random();

            for (int i = 0; i < 6; i++)
            {
                num += r.Next(10).ToString();
            }
            return num;
        }
    }
}
